#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
struct Student
{
	char num[100];
	char name[100];
	double c1;
	double c2;
	double c3;
};
struct Student stu[100];
int main()
{
	for (int i = 0; i < 10; i++)
	{
		scanf("%s", stu[i].num);
		getchar();
		scanf("%s", stu[i].name);
		getchar();
		scanf("%lf%lf%lf", &stu[i].c1, &stu[i].c2, &stu[i].c3);
	}
	double max = 0, t;
	int i;
	for (int j = 0; j < 10; j++)
	{
		t = (stu[j].c1 + stu[j].c2 + stu[j].c3) / 3.0;
		printf("%.1lf ", t / 3.0);
		if (t > max)
		{
			max = t; i = j;
		}
	}
	printf("\n%s %s %.0lf %.0lf %.0lf %.1lf", stu[i].num, stu[i].name, stu[i].c1, stu[i].c2, stu[i].c3, max);
	return 0;
}
